<template>
  <div>
    <HelloWorld />
    <ul>
      <li>不可思议的CSS</li>
      <li>导航栏</li>
      <li>光标下划线跟随</li>
      <li>订单的</li>
    </ul>
    <img src="https://png.pngtree.com/png-clipart/20220404/original/pngtree-d-rendering-male-character-profile-or-avatar-happy-young-man-with-png-image_7512919.png" alt="This is a image">
  </div>
</template>
<script lang="ts">
import HelloWorld from './components/HelloWorld.vue';
import { defineComponent } from 'vue'
export default defineComponent({
  components: { HelloWorld }
})
</script>

<style scoped>
*{
  list-style: none;
}
ul {
    display: flex;
    position: absolute;
    width: 800px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

li {
    position: relative;
    padding: 20px;
    font-size: 24px;
    color: #000;
    line-height: 1;
    transition: 0.2s all linear;
    cursor: pointer;
}

li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 100%;
    width: 0;
    height: 100%;
    background: red;
    border-bottom: 2px solid #000;
    transition: 0.2s all linear;
}

li:hover::before {
    width: 100%;
    top: 0;
    left: 0;
    transition-delay: 0.1s;
    background: red;
    border-bottom-color: #000;
    z-index: -1;
}

li:hover ~ li::before {
    left: 0;
}

li:active {
    background: red;
    color: #fff;
}
/* 头像 */
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-content: center;
  background: #222327;
}
img {
  --s: 100px; /* image 大小*/
  --b: 4px; /* border 像素*/
  --c: #ae3ec9; /* border 颜色 */
  --cb: #e9ecef; /* 背景色 */
  --f: 1; /* 初始缩放 */
  width: var(--s);
  aspect-ratio: 1;
  padding-top: calc(var(--s)/5);
  cursor: pointer;
  border-radius: 0 0 999px 999px;
  --_g: 50%/calc(100%/var(--f)) 100% no-repeat content-box;
  --_o: calc((1/var(--f) - 1)*var(--s)/2 - var(--b));
  outline: var(--b) solid var(--c);
  outline-offset: var(--_o);
  background: 
    radial-gradient(
      circle closest-side,
      var(--cb) calc(99% - var(--b)),var(--c) calc(100% - var(--b)) 99%,#0000
     ) var(--_g);
  -webkit-mask:
    linear-gradient(#000 0 0) no-repeat
     50% calc(1px - var(--_o)) / calc(100%/var(--f) - 2*var(--b) - 2px) 50%,
    radial-gradient(circle closest-side,#000 99%,#0000) var(--_g);
  transform: scale(var(--f));
  transition: .5s;
}
img:hover {
  --f: 1.2; 
}
</style>
